import Layer from "../../common/cmpt/base/Layer";
import { DirUrl } from "../../common/const/Url";
import { eventsOnLoad } from "../../common/util/Events";
import Res from "../../common/util/Res";
import DlgBezierLine from "../../LyShowCase/dialog/DlgBezierLine/DlgBezierLine";
import DlgGuideCase from "../../LyShowCase/dialog/DlgGuide/DlgGuideCase";
import DlgJellyTween from "../../LyShowCase/dialog/DlgJellyTween/DlgJellyTween";
import DlgLyShader from "../../LyShowCase/dialog/DlgLyShader/DlgLyShader";
import DlgLyTip from "../../LyShowCase/dialog/DlgLyTip";
import DlgShufflingFigure from "../../LyShowCase/dialog/DlgShufflingFigure/DlgShufflingFigure";
import DlgAnimValue from "../dialog/DlgAnimValue";
import DlgAudio from "../dialog/DlgAudio";
import DlgCircleList from "../dialog/DlgCircleList";
import DlgEvents from "../dialog/DlgEvents";
import DlgI18N from "../dialog/DlgI18N";
import DlgLayer from "../dialog/DlgLayer";
import DlgMultiTexture from "../dialog/DlgMultiTexture";
import DlgShader from "../dialog/DlgShader";
import DlgShake from "../dialog/DlgShake";
import DlgTimer from "../dialog/DlgTimer";
import DlgVirtualList from "../dialog/DlgVirtualList";

const { ccclass, property } = cc._decorator;

@ccclass
@eventsOnLoad()
export default class Game extends cc.Component {

    private onClickHome() {
        Layer.inst.enterHome();
    }

    private onClickTimer() {
        Layer.inst.openUniDialogAsync(DlgTimer.pUrl);
    }

    private onClickLayer() {
        Layer.inst.openUniDialogAsync(DlgLayer.pUrl);
    }

    private onClickShader() {
        Layer.inst.openUniDialogAsync(DlgShader.pUrl);
    }

    private onClickAnimValue() {
        Layer.inst.openUniDialogAsync(DlgAnimValue.pUrl);
    }

    private onClickButton() {
        Layer.inst.openUniDialogAsync("DlgButton");
    }

    private onClickShake() {
        Layer.inst.openUniDialogAsync(DlgShake.pUrl);
    }

    private onClickVirtualList() {
        Layer.inst.openUniDialogAsync(DlgVirtualList.pUrl);
    }

    private onClickCircleList() {
        Layer.inst.openUniDialogAsync(DlgCircleList.pUrl);
    }

    private async onClickAudio() {
        Layer.inst.openUniDialogAsync(DlgAudio.pUrl);
        Layer.inst.showLoading();
        await Res.loadDir(DirUrl.AUDIO, cc.AudioClip);
        Layer.inst.hideLoading();
    }

    private onClickI18N() {
        Layer.inst.openUniDialogAsync(DlgI18N.pUrl);
    }

    private onClickEvent() {
        Layer.inst.openUniDialogAsync(DlgEvents.pUrl);
    }

    private onClickMultiTexture() {
        Layer.inst.openUniDialogAsync(DlgMultiTexture.pUrl);
    }
    /**轮播图 */
    private onClickShufflingFigure() {
        Layer.inst.openUniDialogAsync(DlgShufflingFigure.pUrl)
        Layer.inst.showLyTip({ url: DlgShufflingFigure.pUrl, title: `轮播图：相比普通的展示，添加了轮动前回调以及滚动结束回调，更符合实际项目需求`, leftTip: ['可以滑动触摸滚动'] })
    }
    /**多阶贝塞尔曲线 */
    private onClickBezierLine() {
        Layer.inst.openUniDialogAsync(DlgBezierLine.pUrl)
        Layer.inst.showLyTip({ url: DlgBezierLine.pUrl, title: `可视化多段三阶贝塞尔曲线`, leftTip: ['可以拖动控制点'] })
    }
    /**挖孔引导 */
    private onClickGuideCase() {
        Layer.inst.openUniDialogAsync(DlgGuideCase.pUrl)
        Layer.inst.showLyTip({ url: DlgGuideCase.pUrl, title: `挖洞新手引导，使用陈皮皮的挖洞方案，配合读取本地配置使用`, leftTip: ['local新手引导', '读取excel的表格引导'] })
    }
    /**果冻弹性效果 */
    private onClickJellyCase() {
        Layer.inst.openUniDialogAsync(DlgJellyTween.pUrl)
        Layer.inst.showLyTip({ url: DlgJellyTween.pUrl, title: `果冻弹性效果` })
    }
    /**展示一些shader */
    private onClickLyShaderCase() {
        Layer.inst.openUniDialogAsync(DlgLyShader.pUrl)
        Layer.inst.showLyTip({ url: DlgLyShader.pUrl, title: `一些shader例子` })
    }

}
